-
Couldn't load subscription status.
- Fork 7
[Chore] Fix Typescript, ESLint, Test error #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR resolves TypeScript and ESLint errors by converting value imports to import type, enabling stricter module syntax, enforcing consistent type imports, and updating VSCode and example configurations.
- Switched numerous imports to
typeonly to satisfy ESLintconsistent-type-imports - Enabled
verbatimModuleSyntaxin TS config and relative imports in VSCode settings - Fixed generic signatures and placeholder return values in
createDefaultApiHandlers
Reviewed Changes
Copilot reviewed 59 out of 59 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/config.ts | Adjusted createAuth generic to MinimalContext<any> and widened TApiRouter to any |
| packages/core/src/collection.ts | Changed imports to type-only and updated InferFields input type |
| packages/core/src/builder.handler.ts | Added TODO placeholder return objects for create/update handlers |
| packages/core/src/auth/index.ts | Updated createAuth signature to use MinimalContext<any> |
| internals/project-config/tsconfig/base.json | Enabled verbatimModuleSyntax |
Comments suppressed due to low confidence (2)
packages/core/src/config.ts:49
- Using
anyfor bothcreateAuthreturn type andApiRouterhere erases the context type, weakening type safety. Consider preserving the originalTContextinstead of falling back toany.
TApiRouter extends ApiRouter<TContext> = ReturnType<typeof createAuth<any>>['handlers'] & ApiRouter<any>,
packages/core/src/auth/index.ts:132
- Specifying
MinimalContext<any>in the generic signature forces all contexts toany, reducing type safety. Consider preserving the genericTContext extends MinimalContextwithout defaulting toany.
export function createAuth<TContext extends MinimalContext<any> = MinimalContext<any>>(config: AuthConfig,
Why I did
What I do
verbatimModuleSyntaxto reduce JS output size which directly affected to published bundled size.'@typescript-eslint/consistent-type-imports': 'error',which will auto fiximport typein the future..vscode/settings.json'stypescript.preferences.importModuleSpecifierto 'relative' to avoid Typescript path error